<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="content-script-type" content="text/javascript"/>
<meta name="version" content="neblog-1.0"/>
<title><!--{$out.title}--></title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/tool.js"></script>
<style>
    .dataout { width:100%; height:660px;overflow-x:scroll;}
</style>
</head>
<body>

<div>
    <div>
    <p><button id="b_pre">pre</button><button id="b_next">next</button><button onclick="window.open('<!--{$out.url}-->', '_blank');">go</button></p>
    <!--{if $out.comments.hot }-->
    <h1>hot</h1>
    <!--{section name=t start=0 loop=$out.comments.hot}-->
        <!--{$smarty.section.t.index}-->,
        <!--{assign var="arr" value=$out.comments.hot[t]}-->
        <!--{section name=s start=0 loop=$arr}-->
        <b><u id="a_go" style="color:blue;cursor:pointer" href="http://t.qq.com/<!--{$arr[s].char_name}-->"><!--{if $arr[s].isOpenMb }--><!--{$arr[s].mb_nick_name}--><!--{else}--><!--{$arr[s].nick}--><!--{/if}--></u><!--{if $arr[s].reply_id|count_characters >= 13 }--><u id="a_go" style="color:blue;cursor:pointer" href="http://t.qq.com/p/t/<!--{$arr[s].reply_id}-->">[w]</u><!--{/if}--></b>[<!--{$arr[s].reply_content}-->]
        <!--{/section}-->
        </span><br>
    <!--{/section}--> 
    <!--{/if}-->
    <!--{if $out.comments.new }-->
    <h1>new</h1>
    <!--{section name=t start=0 loop=$out.comments.new}-->
        <!--{$smarty.section.t.index}-->,
        <!--{assign var="arr" value=$out.comments.new[t]}-->
        <!--{section name=s start=0 loop=$arr}-->
            <b><u id="a_go" style="color:blue;cursor:pointer" href="http://t.qq.com/<!--{$arr[s].char_name}-->"><!--{if $arr[s].isOpenMb }--><!--{$arr[s].mb_nick_name}--><!--{else}--><!--{$arr[s].nick}--><!--{/if}--></u><!--{if $arr[s].reply_id|count_characters >= 13 }--><u id="a_go" style="color:blue;cursor:pointer" href="http://t.qq.com/p/t/<!--{$arr[s].reply_id}-->">[w]</u><!--{/if}--></b>[<!--{$arr[s].reply_content}-->]
        <!--{/section}-->
        </span><br>        
    <!--{/section}--> 
    <!--{/if}-->
    <p><button id="b_pre">pre</button><button id="b_next">next</button><button onclick="window.open('<!--{$out.url}-->', '_blank');">go</button></p>
    </div>
</div>
<script type="text/javascript">

var g_params = getUrlParams();

$().ready(function(){
    $("[id='b_pre']").attr( 'disabled', (g_params['page']>1) ? false : true );
    $("[id='b_next']").attr( 'disabled', '<!--{$out.bnext}-->'=='1' ? false : true );
    $("[id='b_pre']").click(function(){
        var page = g_params['page'] ? g_params['page'] : 0;
        page = parseInt( page );
        chngPage( page-1 );
    });
    $("[id='b_next']").click(function(){
        var page = g_params['page'] ? g_params['page'] : 1;
        page = parseInt( page );
        chngPage( page+1 );
    });
    $("[id='a_go']").click(function(){
        window.open($(this).attr("href"), "_blank");
    });
});

function getUrlParams()
{
    var search = window.location.search ; 
    // 写入数据字典
    var tmparray = search.substr(1,search.length).split("&");
    var paramsArray = new Array; 
    if( tmparray != null)
    {
        for(var i = 0;i<tmparray.length;i++)
        {
            var reg = /[=|^==]/;    // 用=进行拆分，但不包括==
            var set1 = tmparray[i].replace(reg,'&');
            var tmpStr2 = set1.split('&');
            paramsArray[tmpStr2[0]] = tmpStr2[1] ; 
        }
    }
    // 将参数数组进行返回
    return paramsArray ;     
}

function chngPage( page )
{
    var link = window.location.href;
    link = link.replace(/&page=[0-9\-+]*/, '');
    link = link+'&page='+page;
    window.location.href = link;
}

</script>

</body>
</html>
